#pragma once
#include <vector>
#include <math.h>

#include "Color.h"
#include "Random.h"
#include "Image.h"
#include "Constants.h"

struct Particle
{
	int life;
	float xPos, yPos, xVel, yVel, width, height;
	Color color;
};

class ParticleSystem
{
private:
	std::vector<Particle*> particleList;
protected:
	Image* image;
	int blendMode;

	virtual void updateParticle(Particle* p);
	virtual void spawn();
	void renderParticle(Particle* p, float xOffset, float yOffset, float interpolation);

	void addParticle(Particle* p); //adds particle to list.
public:
	ParticleSystem(Image* i);
	~ParticleSystem(void);

	void update();
	void render(float x, float y, float interpolation);
};
